package org.distribute.meal.service.impl;

import org.distribute.meal.entity.TbMeal;
import org.distribute.meal.mapper.TbMealMapper;
import org.distribute.meal.service.MealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.dubbo.config.annotation.Service;

/**
 * rpc服务接口实现类
 */
@Service(interfaceClass = MealService.class) //dubbo的service，注入接口
@Component //spring注解，扫描包
public class MealServiceImpl implements MealService {
	@Autowired
	private TbMealMapper mealMapper;
	
	@Override
	@Transactional
	public int addMeal(String orderId, String dispatchSeq,
			String dispatchContent) {
		TbMeal meal = new TbMeal();
		meal.setOrderId(orderId);
		meal.setDispatchSeq(dispatchSeq);
		meal.setDispatchContent(dispatchContent);
		
		return mealMapper.insert(meal);
	}
}
